package com.codeoss.framework.db.column;

import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;

import org.springframework.stereotype.Service;

import com.codeoss.framework.context.YunContext;
import com.codeoss.framework.data.metadata.Column;

@Service("binaryColumnService")
public class BinaryColumnService implements IColumnService{

	@Override
	public Object getValue(YunContext yunContext, Column column, ResultSet rs) throws SQLException {
		// TODO Auto-generated method stub
		return rs.getBytes(column.getColumnName());
	}

	@Override
	public void setValue(YunContext yunContext, Column column, PreparedStatement ps, int index, Object value)
			throws SQLException {
		// TODO Auto-generated method stub
		ps.setBytes(index,(byte[])value);
	}

}
